< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03103000.xhp

(section: ubound) (bookmark: bm_id3148538)
UBound function

UBound 関数

UBound Function [Runtime]
UBound 関数 [実行時](hd_id3148538.1)

Returns the upper boundary of an array.
配列のインデックス範囲の最大値を返します。(par_id3147573.2)

(/section: ubound)

Syntax:
構文:(hd_id3150984.3)

UBound (ArrayName [, Dimension])
UBound (ArrayName [, Dimension])(par_id3149415.4)

Return value:
戻り値:(hd_id3153897.5)

Integer
整数(par_id3149670.6)

Parameters:
パラメータ:(hd_id3154347.7)

ArrayName: Name of the array for which you want to determine the upper (Ubound) or the lower (LBound) boundary.
ArrayName: インデックス範囲の最大値 (Ubound) ないし最小値 (LBound) を確認する配列の名前。(par_id3153381.8)

[Dimension]: Integer that specifies which dimension to return the upper(Ubound) or lower (LBound) boundary for. If no value is specified, the boundary of the first dimension is returned.
[Dimension]: インデックス範囲の最大値 (Ubound) ないし最小値 (LBound) を確認する次元を示す整数値。この値を指定しない場合は、最初の次元のインデックス範囲が返されます。(par_id3148797.9)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

(embed text/sbasic/shared/00000003.xhp#err9 : linkinfo)

9 Subscript out of range
9 サブスクリプトが範囲外です(par_id3148900.45)

(/embed text/sbasic/shared/00000003.xhp#err9)

Example:
例:(hd_id3153192.10)

Sub ExampleUboundLbound
Sub ExampleUboundLbound(par_id3147229.11)

Dim sVar(10 to 20) As String
Dim sVar(10 to 20) As String(par_id3150440.12)

print LBound(sVar())
print LBound(sVar())(par_id3145785.13)

print UBound(sVar())
print UBound(sVar())(par_id3153092.14)

end Sub
end Sub(par_id3153727.15)

Sub ExampleUboundLbound2
Sub ExampleUboundLbound2(par_id3145271.16)

Dim sVar(10 to 20,5 To 70) As String
Dim sVar(10 to 20,5 To 70) As String(par_id3153952.17)

Print LBound(sVar()) REM Returns 10
Print LBound(sVar()) REM 戻り値は 10(par_id3152596.18)

Print UBound(sVar()) REM Returns 20
UBound(sVar()) REM 戻り値は 20(par_id3153138.19)

Print LBound(sVar(),2) REM Returns 5
Print LBound(sVar(),2) REM 戻り値は 5(par_id3149665.20)

Print UBound(sVar(),2) REM Returns 70
Print UBound(sVar(),2) REM 戻り値は 70(par_id3147214.21)

end Sub
end Sub(par_id3155855.22)


< Prev / Next >